


let fs = require('fs');
let path = require('path');
let JXON = require('jxon');

let content = fs.readFileSync(path.join(__dirname,'fogs.plist'),'utf8');
let jsObject = JXON.stringToJs(content);
console.log(jsObject);

//  load atlas
function loadAtlas(pngPath, xmlPath) {
    let req = new XMLHttpRequest();
    req.timeout = 5000;
    req.addEventListener('load', function (evt) {
        let text = req.responseText;
        let jsObject = JXON.stringToJs(text);
        console.log(jsObject);
    });
    req.addEventListener('error', function (evt) {
        console.error(`evt:${evt}`);
    });

    req.responseType = 'text';
    req.open('GET', xmlPath);
    req.send();


    // load png
    let img = new Image();
    img.src = pngPath;
    img.onload = function () {

    };
    img.onerror = function () {

    };
}

